package xdu.lz.stage1_basic.chapter1_threadsafe.lock;

import java.util.Collection;

public interface Lock {
    class TimeOutException extends Exception{
        public TimeOutException(String message) {
            super(message);
        }
    }


    void lock() throws InterruptedException;

    void tryLock(Long mills) throws InterruptedException,TimeOutException;

    void unlock();

    Collection<Thread> getBlockedThread();

    int getBlockedSize();
}
